package com.github.niefy.modules.wx.service.impl;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.niefy.modules.wx.dao.ChangduUserRechargeMapper;
import com.github.niefy.modules.wx.entity.ChangduUserRecharge;
import com.github.niefy.modules.wx.service.ChangduUserRechargeService;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChangduUserRechargeServiceImpl
        extends ServiceImpl<ChangduUserRechargeMapper, ChangduUserRecharge>
        implements ChangduUserRechargeService {

    @Override
    public List<ChangduUserRecharge> saveService(List<ChangduUserRecharge> inputList) {
        if (ObjectUtils.isEmpty(inputList)) {
            return Lists.newArrayList();
        }
        super.saveBatch(inputList);
        return inputList;
    }

    @Override
    public List<ChangduUserRecharge> listByIdService(List<Long> tradeNoList) {
        if (ObjectUtils.isEmpty(tradeNoList)) {
            return Lists.newArrayList();
        }
        List<ChangduUserRecharge> dbList = listByIds(tradeNoList);
        return ObjectUtils.isEmpty(dbList) ? Lists.newArrayList() : dbList;
    }
}
